//
//  YLMallSlideImageHeaderView.m
//  YLFinanceService
//
//  Created by she1323 on 2017/9/5.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLMallSlideImageHeaderView.h"
#import "YLGlobeHeader.h"
#import <SDCycleScrollView.h>

@interface YLMallSlideImageHeaderView ()<SDCycleScrollViewDelegate>
@property (nonatomic, weak) SDCycleScrollView *cycleScrollView;
@property (weak, nonatomic) IBOutlet UIView *slideImagebBaseView;

@end

@implementation YLMallSlideImageHeaderView

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self setUpUI];
}

+ (NSString *)headerID
{
    return @"YLMallSlideImageHeaderView";
}


- (void)setUpUI
{
    self.backgroundColor = [UIColor whiteColor];
    
    SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, YLScreenW, YLScreenW * 0.49) delegate:self placeholderImage:nil];
    cycleScrollView.currentPageDotColor = YLColor(240, 178, 42);
    cycleScrollView.pageDotColor = YLColor(243, 207, 133);
    _cycleScrollView = cycleScrollView;
    _cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
    _cycleScrollView.autoScrollTimeInterval = 5.0;
    _cycleScrollView.imageURLStringsGroup = @[@"http://www.diaojimao.com/data/upload/admin/20170816/599320c91d9f1.jpg", @"http://www.diaojimao.com/data/upload/admin/20170816/599320c91d9f1.jpg", @"http://www.diaojimao.com/data/upload/admin/20170816/599320c91d9f1.jpg"];
    [_slideImagebBaseView addSubview:cycleScrollView];
    
}

+ (NSString *)headID
{
    return @"YLSlideIamgeHeadView";
}

#pragma mark - 点击图片Bannar跳转
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
    NSLog(@"点击了%zd轮播图",index);
}


@end
